// HJ23.删除字符串中出现次数最少的字符
// https://www.nowcoder.com/practice/05182d328eb848dda7fdd5e029a56da9
// 实现删除字符串中出现次数最少的字符，若出现次数最少的字符有多个，
// 则把出现次数最少的字符都删除。输出删除这些单词后的字符串，
// 字符串中其它字符保持原来的顺序。

#include <algorithm>
#include <iostream>
#include <map>
#include <memory>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;

int main_hj23() {
  map<char, int> mapChar;
  string str;
  while (cin >> str) {
    for (int i = 0; i < str.size(); i++) {
      mapChar[str[i]]++;
    }
    vector<char> vtChar;
    int minV = 10000;
    for (auto it : mapChar) {
      minV = min(minV, it.second);
    }
    string res;
    for (int i = 0; i < str.size(); i++) {
      if (mapChar[str[i]] == minV) {
        continue;
      }
      res += str[i];
    }
    printf("%s\n", res.c_str());
  }
  return 0;
}
